package GUI;


/**
 *
 * @author dirk
 */
public class ItemBag
{
    private int m_noItems = 0;
    private String [] m_items = new String [50];

    //constructor
    public ItemBag()
    {
    }

    //Add an item to the bag
    public void addItem(String item)
    {
        if(m_noItems < 20)
        {
            m_items[m_noItems] = item;
            m_noItems++;
        }
    }

    public String getItems()
    {
        String returnString = "";
        for(int i =0; i < m_noItems; i++)
        {
            returnString = returnString + m_items[i]+"\n";
        }
        return returnString;
        
    }

    //Look if the bag contains the certain item (Returns true/false)
    public boolean containsItem(String item)
    {
        for(int i = 0; i < m_noItems; i++)
        {
            if(m_items[i].equals(item))
            {
                return true;
            }
        }
        return false;
    }

}
